<div class="container">
  <div class="container_inside">
    <div class="content_left">
	  <?php
	  	$ibizmag_cat_1 = get_option('ibizmag_cat_1');
		
		$is_category_selected = "true";
		
		if($ibizmag_cat_1 == "0" || strlen($ibizmag_cat_1) == 0)
			$is_category_selected = "false";
			
		
		if($is_category_selected == "true")
		{
			$cat = $ibizmag_cat_1;
			query_posts('cat='.$cat);     
			$count = 0; 
		}
      ?>
      <div class="content_box">
		  <?php if($is_category_selected == "true") : ?>
            <h2><?php echo get_category_name($cat); ?></h2>
              <?php if (have_posts()) : ?>
                
                <?php while (have_posts()) : the_post(); ?>
                <?php
                    $ibizmag_post_excerpt = $post->post_content;
                    $ibizmag_postimg_100px = get_post_meta($post->ID, "ibizmag_postimg_100px", true);
                ?>
                <?php
                if($count == 0)
                {
                ?>
                <h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
                <img src="<?php echo $ibizmag_postimg_100px; ?>" width="100" height="100" alt="<?php the_title(); ?>" />
                <div class="box_description"><?php custom_excerpt($ibizmag_post_excerpt, 300); ?></div>
                <div class="box_read_more"> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">Read More</a> </div>
                
                <div class="box_more_text">MORE:</div>
                <ul class="box_links">
                <?php
                }
                else
                {
					if($count > 2)
						break;
                ?>
                  <li> <a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </li>
                <?php
                }
                ?>
                <?php $count++; ?>
                <?php endwhile; ?>
                </ul>
              <?php else: ?>
                No post available for this category.
              <?php endif; ?>
          <?php else: ?>
            <h2>No Featured Category #1 Selected</h2>
        	<h3>Please select featured category #1 via theme option.</h3>
          <?php endif; ?>  
      </div>
      
      
      <?php
	  	$ibizmag_cat_3 = get_option('ibizmag_cat_3');
		
		$is_category_selected = "true";
		
		if($ibizmag_cat_3 == "0" || strlen($ibizmag_cat_3) == 0)
			$is_category_selected = "false";
			
		
		if($is_category_selected == "true")
		{
			$cat = $ibizmag_cat_3;
			query_posts('cat='.$cat);     
			$count = 0; 
		}
      ?>
      <div class="content_box">
		  <?php if($is_category_selected == "true") : ?>
            <h2><?php echo get_category_name($cat); ?></h2>
              <?php if (have_posts()) : ?>
                
                <?php while (have_posts()) : the_post(); ?>
                <?php
                    $ibizmag_post_excerpt = $post->post_content;
                    $ibizmag_postimg_100px = get_post_meta($post->ID, "ibizmag_postimg_100px", true);
                ?>
                <?php
                if($count == 0)
                {
                ?>
                <h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
                <img src="<?php echo $ibizmag_postimg_100px; ?>" width="100" height="100" alt="<?php the_title(); ?>" />
                <div class="box_description"><?php custom_excerpt($ibizmag_post_excerpt, 300); ?></div>
                <div class="box_read_more"> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">Read More</a> </div>
                
                <div class="box_more_text">MORE:</div>
                <ul class="box_links">
                <?php
                }
                else
                {
					if($count > 2)
						break;
                ?>
                  <li> <a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </li>
                <?php
                }
                ?>
                <?php $count++; ?>
                <?php endwhile; ?>
                </ul>
              <?php else: ?>
                No post available for this category.
              <?php endif; ?>
          <?php else: ?>
            <h2>No Featured Category #3 Selected</h2>
        	<h3>Please select featured category #3 via theme option.</h3>
          <?php endif; ?>  
      </div>
      
      
      
    </div>
    <div class="content_right">
      
	  
	  <?php
	  	$ibizmag_cat_2 = get_option('ibizmag_cat_2');
		
		$is_category_selected = "true";
		
		if($ibizmag_cat_2 == "0" || strlen($ibizmag_cat_2) == 0)
			$is_category_selected = "false";
			
		
		if($is_category_selected == "true")
		{
			$cat = $ibizmag_cat_2;
			query_posts('cat='.$cat);     
			$count = 0; 
		}
      ?>
      <div class="content_box">
		  <?php if($is_category_selected == "true") : ?>
            <h2><?php echo get_category_name($cat); ?></h2>
              <?php if (have_posts()) : ?>
                
                <?php while (have_posts()) : the_post(); ?>
                <?php
                    $ibizmag_post_excerpt = $post->post_content;
                    $ibizmag_postimg_100px = get_post_meta($post->ID, "ibizmag_postimg_100px", true);
                ?>
                <?php
                if($count == 0)
                {
                ?>
                <h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
                <img src="<?php echo $ibizmag_postimg_100px; ?>" width="100" height="100" alt="<?php the_title(); ?>" />
                <div class="box_description"><?php custom_excerpt($ibizmag_post_excerpt, 300); ?></div>
                <div class="box_read_more"> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">Read More</a> </div>
                
                <div class="box_more_text">MORE:</div>
                <ul class="box_links">
                <?php
                }
                else
                {
					if($count > 2)
						break;
                ?>
                  <li> <a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </li>
                <?php
                }
                ?>
                <?php $count++; ?>
                <?php endwhile; ?>
                </ul>
              <?php else: ?>
                No post available for this category.
              <?php endif; ?>
          <?php else: ?>
            <h2>No Featured Category #2 Selected</h2>
        	<h3>Please select featured category #2 via theme option.</h3>
          <?php endif; ?>  
      </div>
      
      
	  
	  
	  <?php
	  	$ibizmag_cat_4 = get_option('ibizmag_cat_4');
		
		$is_category_selected = "true";
		
		if($ibizmag_cat_2 == "0" || strlen($ibizmag_cat_4) == 0)
			$is_category_selected = "false";
			
		
		if($is_category_selected == "true")
		{
			$cat = $ibizmag_cat_4;
			query_posts('cat='.$cat);     
			$count = 0; 
		}
      ?>
      <div class="content_box">
		  <?php if($is_category_selected == "true") : ?>
            <h2><?php echo get_category_name($cat); ?></h2>
              <?php if (have_posts()) : ?>
                
                <?php while (have_posts()) : the_post(); ?>
                <?php
                    $ibizmag_post_excerpt = $post->post_content;
                    $ibizmag_postimg_100px = get_post_meta($post->ID, "ibizmag_postimg_100px", true);
                ?>
                <?php
                if($count == 0)
                {
                ?>
                <h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
                <img src="<?php echo $ibizmag_postimg_100px; ?>" width="100" height="100" alt="<?php the_title(); ?>" />
                <div class="box_description"><?php custom_excerpt($ibizmag_post_excerpt, 300); ?></div>
                <div class="box_read_more"> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">Read More</a> </div>
                
                <div class="box_more_text">MORE:</div>
                <ul class="box_links">
                <?php
                }
                else
                {
					if($count > 2)
						break;
                ?>
                  <li> <a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </li>
                <?php
                }
                ?>
                <?php $count++; ?>
                <?php endwhile; ?>
                </ul>
              <?php else: ?>
                No post available for this category.
              <?php endif; ?>
          <?php else: ?>
            <h2>No Featured Category #4 Selected</h2>
        	<h3>Please select featured category #4 via theme option.</h3>
          <?php endif; ?>  
      </div>
      
      
      
    </div>
  </div>
</div>